package Utils;

import javax.servlet.http.Part;
import java.io.File;
import java.util.UUID;

public class FileUploadUtils {
    public static String uploadPic(Part part)throws Exception{
        String pic=part.getSubmittedFileName();
        String path= "E:/stupic";
        File file = new File(path);
        if (!file.exists()){
            file.mkdir();
        }
        pic= UUID.randomUUID()+pic;
        part.write(path+"/"+pic);
        return pic;
    }
}
